package com.system.boot.rbac.converter;

import com.system.api.rbac.entity.dto.MenuFormDto;
import com.system.api.rbac.entity.po.SysMenu;
import com.system.api.rbac.entity.search.MenuSearch;
import com.system.api.setting.entity.search.IconSearch;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import org.yang.database.orm.entity.BaseQuery;

/**
 * @author: lslands
 * @description:
 * @version：v1.0
 * @date: 2024/6/2 00:14
 */
@Mapper(builder = @org.mapstruct.Builder(disableBuilder = true),componentModel = "spring")
public interface MenuConverter {

    MenuConverter INSTANCE = Mappers.getMapper(MenuConverter.class);
    /**
     * 转换 dtoForm -> po
     * @param formDto 插入对象
     * @return SysDict
     */
    SysMenu formEntity(MenuFormDto formDto);

    /**
     * 转换 search -> BaseQuery
     * @param search 搜索对象转换
     * @return BaseQuery
     */
    BaseQuery queryEntity(MenuSearch search);

    /**
     * 转换 search -> po
     * @param search 搜索对象转换
     * @return BaseQuery
     */
    SysMenu queryPoEntity(MenuSearch search);
}
